/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
package prestar.vistas.ventanas;
import java.awt.Component;
import java.util.Calendar;
import java.util.Date;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.RowFilter;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
import prestar.dominio.controladores.Financiera;
import prestar.dominio.entidades.*;
/**
 *
 * @author gadiel
 */
public class financiamientos extends javax.swing.JFrame implements TableModelListener
{
    /**
     * Creates new form financiamientos
     */
    public financiamientos() 
    {
        initComponents();
        this.jTable1.getModel().addTableModelListener(this);
        this.setLocationRelativeTo(null);
        
        this.financiamiento.setTipo(this.jComboBoxTipo.getSelectedItem().toString());
        this.financiamiento.getTasa().setPeriodo(this.jComboBoxPeriodoTasa.getSelectedItem().toString());
        this.financiamiento.getPlazo().setUnidad(this.jComboBoxPeriodoPlazo.getSelectedItem().toString());
        this.financiamiento.setFrecCuotas(this.jComboBoxPeriodoCuotas.getSelectedItem().toString());
        
        this.jTextFieldFecha1.setText(util.Fechas.stringValue(new Date()));
        this.cobro.setFecha(new Date());
        this.jTextFieldCodCli.requestFocus();
        this.jTextFieldFecha.setText(util.Fechas.stringValue(Calendar.getInstance().getTime()));
        if (Financiera.getInstancia().getUsuario().getPermisos().indexOf("fanalisis") < 0)
        {
            this.jTabbedPane1.remove(6);
        }
        
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jPanelFinanciamiento = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        jTextFieldCapital = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jTextFieldTasa = new javax.swing.JTextField();
        jComboBoxPeriodoTasa = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();
        jTextFieldPlazo = new javax.swing.JTextField();
        jComboBoxPeriodoPlazo = new javax.swing.JComboBox();
        jLabel7 = new javax.swing.JLabel();
        jComboBoxPeriodoCuotas = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        jComboBoxTipo = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        jTextFieldFecha = new javax.swing.JFormattedTextField();
        jScrollPaneAmortizacion = new javax.swing.JScrollPane();
        jTableAmortizacion = new javax.swing.JTable();
        jPanelPersonales = new javax.swing.JPanel();
        jTextFieldNomCli = new javax.swing.JTextField();
        jTextFieldNomGar = new javax.swing.JTextField();
        jTextFieldNomCob = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();
        jTextFieldCodCli = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jTextFieldCodGar = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        jTextFieldCodCob = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jButtonAceptar = new javax.swing.JButton();
        jButtonReimprimirFin = new javax.swing.JButton();
        jButtonCancelar = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jPanel6 = new javax.swing.JPanel();
        jButtonEfectuarPago = new javax.swing.JButton();
        jButtonCancelar1 = new javax.swing.JButton();
        jButtonReimprimirCobro = new javax.swing.JButton();
        jPanel7 = new javax.swing.JPanel();
        jTextFieldCodCli1 = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jButton6 = new javax.swing.JButton();
        jTextFieldNomCli1 = new javax.swing.JTextField();
        jTextFieldCodFin = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jButton7 = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jButtonFindCuotas = new javax.swing.JButton();
        jLabelTotalCobro = new javax.swing.JLabel();
        jLabelTotalCobro1 = new javax.swing.JLabel();
        jButtonRemoverItems = new javax.swing.JButton();
        jPanel31 = new javax.swing.JPanel();
        jTextFieldFecha1 = new javax.swing.JFormattedTextField();
        jLabel40 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jPanel8 = new javax.swing.JPanel();
        jBtnGuardarCli = new javax.swing.JButton();
        jBtnEliminarCli = new javax.swing.JButton();
        jBtnImprimirCli = new javax.swing.JButton();
        jBtnCancelarCli = new javax.swing.JButton();
        jButtonBalance = new javax.swing.JButton();
        jPanel9 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jTextNombCli = new javax.swing.JTextField();
        jTextApellCli = new javax.swing.JTextField();
        jTextDirCli = new javax.swing.JTextField();
        jTextCedCli = new javax.swing.JFormattedTextField();
        jPanel12 = new javax.swing.JPanel();
        jPanel13 = new javax.swing.JPanel();
        jLabel20 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTableClientes = new javax.swing.JTable();
        jPanel27 = new javax.swing.JPanel();
        jScrollPane8 = new javax.swing.JScrollPane();
        jTableTelCli = new javax.swing.JTable();
        jTextNombCli1 = new javax.swing.JTextField();
        jLabel35 = new javax.swing.JLabel();
        jButton4 = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jTextNombGar = new javax.swing.JTextField();
        jTextApellGar = new javax.swing.JTextField();
        jTextDirGar = new javax.swing.JTextField();
        jTextCedGar = new javax.swing.JFormattedTextField();
        jPanel11 = new javax.swing.JPanel();
        jBtnGuardarGar = new javax.swing.JButton();
        jBtnEliminarGar = new javax.swing.JButton();
        jBtnImprimirGar = new javax.swing.JButton();
        jBtnCancelarGar = new javax.swing.JButton();
        jPanel14 = new javax.swing.JPanel();
        jLabel21 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTableGarantes = new javax.swing.JTable();
        jPanel28 = new javax.swing.JPanel();
        jScrollPane9 = new javax.swing.JScrollPane();
        jTableTelGar = new javax.swing.JTable();
        jTextNombCli2 = new javax.swing.JTextField();
        jLabel36 = new javax.swing.JLabel();
        jButton5 = new javax.swing.JButton();
        jPanel15 = new javax.swing.JPanel();
        jPanel16 = new javax.swing.JPanel();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jTextNombCob = new javax.swing.JTextField();
        jTextApellCob = new javax.swing.JTextField();
        jTextDirCob = new javax.swing.JTextField();
        jTextCedCob = new javax.swing.JFormattedTextField();
        jPanel17 = new javax.swing.JPanel();
        jBtnGuardarCob = new javax.swing.JButton();
        jBtnEliminarCob = new javax.swing.JButton();
        jBtnImprimirCob = new javax.swing.JButton();
        jBtnCancelarCob = new javax.swing.JButton();
        jPanel18 = new javax.swing.JPanel();
        jLabel26 = new javax.swing.JLabel();
        jTextField3 = new javax.swing.JTextField();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTableCobradores = new javax.swing.JTable();
        jPanel29 = new javax.swing.JPanel();
        jScrollPane10 = new javax.swing.JScrollPane();
        jTableTelCob = new javax.swing.JTable();
        jTextNombCli3 = new javax.swing.JTextField();
        jLabel37 = new javax.swing.JLabel();
        jButton8 = new javax.swing.JButton();
        jPanel19 = new javax.swing.JPanel();
        jPanel20 = new javax.swing.JPanel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jTextNombUsuario = new javax.swing.JTextField();
        jTextApellUsuario = new javax.swing.JTextField();
        jTextDirUsuario = new javax.swing.JTextField();
        jTextCedUsuario = new javax.swing.JFormattedTextField();
        jPanel22 = new javax.swing.JPanel();
        jTextField4 = new javax.swing.JTextField();
        jLabel31 = new javax.swing.JLabel();
        jScrollPane5 = new javax.swing.JScrollPane();
        jTableUsuarios = new javax.swing.JTable();
        jPanel23 = new javax.swing.JPanel();
        jTextNickUsuario = new javax.swing.JTextField();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        jTextReptClaveUsuario = new javax.swing.JPasswordField();
        jTextClaveUsuario = new javax.swing.JPasswordField();
        jPanel21 = new javax.swing.JPanel();
        jBtnGuardarUsuario = new javax.swing.JButton();
        jBtnEliminarUsuario = new javax.swing.JButton();
        jBtnImprimirUsuario = new javax.swing.JButton();
        jBtnCancelarUsuario = new javax.swing.JButton();
        jButtonPermisos = new javax.swing.JButton();
        jButtonLog = new javax.swing.JButton();
        jPanel30 = new javax.swing.JPanel();
        jScrollPane11 = new javax.swing.JScrollPane();
        jTableTelUser = new javax.swing.JTable();
        jTextNombCli4 = new javax.swing.JTextField();
        jLabel38 = new javax.swing.JLabel();
        jButton9 = new javax.swing.JButton();
        jPanel24 = new javax.swing.JPanel();
        jTabbedPane2 = new javax.swing.JTabbedPane();
        jPanel25 = new javax.swing.JPanel();
        jScrollPane6 = new javax.swing.JScrollPane();
        jTableFinanciamientos = new javax.swing.JTable();
        jPanel26 = new javax.swing.JPanel();
        jScrollPane7 = new javax.swing.JScrollPane();
        jTableCobros = new javax.swing.JTable();
        jPanel32 = new javax.swing.JPanel();
        jPanel33 = new javax.swing.JPanel();
        jLabel41 = new javax.swing.JLabel();
        jLabel42 = new javax.swing.JLabel();
        jLabel44 = new javax.swing.JLabel();
        jTextNombFinanciera = new javax.swing.JTextField();
        jTextDirFinanciera = new javax.swing.JTextField();
        jTextRncFinanciera = new javax.swing.JFormattedTextField();
        jPanel34 = new javax.swing.JPanel();
        jScrollPane12 = new javax.swing.JScrollPane();
        jTableTelFinanciera = new javax.swing.JTable();
        jTextEmailFinanciera = new javax.swing.JTextField();
        jLabel45 = new javax.swing.JLabel();
        jButtonAddPhoneFinanciera = new javax.swing.JButton();
        jPanel35 = new javax.swing.JPanel();
        jLabel43 = new javax.swing.JLabel();
        jLabel46 = new javax.swing.JLabel();
        jSpinnerMoraFinanciera = new javax.swing.JSpinner();
        jSpinnerGraciaMoraFinanciera = new javax.swing.JSpinner();
        jButtonAceptConfig = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("PreStar");

        jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jTabbedPane1StateChanged(evt);
            }
        });

        jPanelFinanciamiento.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos del financiamiento"));

        jLabel4.setText("Capital");

        jTextFieldCapital.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                focusLostPrestamo(evt);
            }
        });

        jLabel5.setText("Tasa");

        jTextFieldTasa.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                focusLostPrestamo(evt);
            }
        });

        jComboBoxPeriodoTasa.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Anual", "Mensual", "Semanal", "Diario" }));
        jComboBoxPeriodoTasa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxsFinancAction(evt);
            }
        });

        jLabel6.setText("Plazo");

        jTextFieldPlazo.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                focusLostPrestamo(evt);
            }
        });

        jComboBoxPeriodoPlazo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Años", "Meses", "Semanas", "Dias" }));
        jComboBoxPeriodoPlazo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxsFinancAction(evt);
            }
        });

        jLabel7.setText("Pagos");

        jComboBoxPeriodoCuotas.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Anuales", "Mensuales", "Semanales", "Diarias" }));
        jComboBoxPeriodoCuotas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxsFinancAction(evt);
            }
        });

        jLabel1.setText("%");

        jComboBoxTipo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Método lineal", "Método francés", "Capital + interés", "Solo interés" }));
        jComboBoxTipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxsFinancAction(evt);
            }
        });

        jLabel2.setText("Método");

        jLabel39.setText("Fecha");

        try {
            jTextFieldFecha.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##-##-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jTextFieldFecha.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                focusLostPrestamo(evt);
            }
        });

        javax.swing.GroupLayout jPanelFinanciamientoLayout = new javax.swing.GroupLayout(jPanelFinanciamiento);
        jPanelFinanciamiento.setLayout(jPanelFinanciamientoLayout);
        jPanelFinanciamientoLayout.setHorizontalGroup(
            jPanelFinanciamientoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelFinanciamientoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelFinanciamientoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelFinanciamientoLayout.createSequentialGroup()
                        .addGroup(jPanelFinanciamientoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4)
                            .addComponent(jLabel6))
                        .addGap(18, 18, 18)
                        .addGroup(jPanelFinanciamientoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanelFinanciamientoLayout.createSequentialGroup()
                                .addComponent(jTextFieldPlazo, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBoxPeriodoPlazo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jTextFieldCapital)))
                    .addGroup(jPanelFinanciamientoLayout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBoxTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGroup(jPanelFinanciamientoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelFinanciamientoLayout.createSequentialGroup()
                        .addGap(17, 17, 17)
                        .addGroup(jPanelFinanciamientoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel39)
                            .addComponent(jLabel5))
                        .addGap(18, 18, 18)
                        .addGroup(jPanelFinanciamientoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelFinanciamientoLayout.createSequentialGroup()
                                .addGap(1, 1, 1)
                                .addComponent(jTextFieldFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanelFinanciamientoLayout.createSequentialGroup()
                                .addComponent(jTextFieldTasa, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(4, 4, 4)
                                .addComponent(jLabel1)))
                        .addGap(5, 5, 5)
                        .addComponent(jComboBoxPeriodoTasa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelFinanciamientoLayout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jLabel7)
                        .addGap(18, 18, 18)
                        .addComponent(jComboBoxPeriodoCuotas, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanelFinanciamientoLayout.setVerticalGroup(
            jPanelFinanciamientoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelFinanciamientoLayout.createSequentialGroup()
                .addGroup(jPanelFinanciamientoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jComboBoxTipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel39)
                    .addComponent(jTextFieldFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanelFinanciamientoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jComboBoxPeriodoTasa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldTasa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)
                    .addComponent(jTextFieldCapital, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelFinanciamientoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jComboBoxPeriodoCuotas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7)
                    .addComponent(jComboBoxPeriodoPlazo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldPlazo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addContainerGap())
        );

        jTableAmortizacion.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null}
            },
            new String [] {
                "Fecha", "interes del período", "Cuota", "Monto", "Capital Vivo"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPaneAmortizacion.setViewportView(jTableAmortizacion);

        jPanelPersonales.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos personales"));

        jTextFieldNomCli.setEditable(false);

        jTextFieldNomGar.setEditable(false);

        jTextFieldNomCob.setEditable(false);

        jButton1.setText("...");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("...");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("...");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jLabel8.setText("Cliente");

        jTextFieldCodCli.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTextFieldCodCliFocusLost(evt);
            }
        });

        jLabel9.setText("Garante");

        jTextFieldCodGar.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTextFieldCodGarFocusLost(evt);
            }
        });

        jLabel10.setText("Cobrador");

        jTextFieldCodCob.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTextFieldCodCobFocusLost(evt);
            }
        });

        javax.swing.GroupLayout jPanelPersonalesLayout = new javax.swing.GroupLayout(jPanelPersonales);
        jPanelPersonales.setLayout(jPanelPersonalesLayout);
        jPanelPersonalesLayout.setHorizontalGroup(
            jPanelPersonalesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPersonalesLayout.createSequentialGroup()
                .addGroup(jPanelPersonalesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelPersonalesLayout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addComponent(jLabel8))
                    .addGroup(jPanelPersonalesLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel9))
                    .addGroup(jPanelPersonalesLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel10)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPersonalesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextFieldCodCli, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldCodGar, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldCodCob, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26)
                .addGroup(jPanelPersonalesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton1)
                    .addComponent(jButton2)
                    .addComponent(jButton3))
                .addGap(18, 18, 18)
                .addGroup(jPanelPersonalesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextFieldNomCli)
                    .addComponent(jTextFieldNomGar)
                    .addComponent(jTextFieldNomCob, javax.swing.GroupLayout.PREFERRED_SIZE, 308, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(100, 100, 100))
        );

        jPanelPersonalesLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jTextFieldCodCli, jTextFieldCodCob, jTextFieldCodGar});

        jPanelPersonalesLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jTextFieldNomCli, jTextFieldNomCob, jTextFieldNomGar});

        jPanelPersonalesLayout.setVerticalGroup(
            jPanelPersonalesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPersonalesLayout.createSequentialGroup()
                .addGroup(jPanelPersonalesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jTextFieldNomCli, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1)
                    .addComponent(jTextFieldCodCli, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPersonalesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jTextFieldNomGar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton2)
                    .addComponent(jTextFieldCodGar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPersonalesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jTextFieldNomCob, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton3)
                    .addComponent(jTextFieldCodCob, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10))
                .addGap(0, 0, Short.MAX_VALUE))
        );

        jButtonAceptar.setText("Aceptar");
        jButtonAceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAceptarActionPerformed(evt);
            }
        });

        jButtonReimprimirFin.setText("Reimprimir");
        jButtonReimprimirFin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonReimprimirFinActionPerformed(evt);
            }
        });

        jButtonCancelar.setText("Cancelar");
        jButtonCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonCancelarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButtonAceptar)
                .addGap(95, 95, 95)
                .addComponent(jButtonReimprimirFin)
                .addGap(65, 65, 65)
                .addComponent(jButtonCancelar)
                .addGap(61, 61, 61))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addGap(0, 12, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonAceptar)
                    .addComponent(jButtonReimprimirFin)
                    .addComponent(jButtonCancelar)))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(191, 191, 191)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jScrollPaneAmortizacion, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanelPersonales, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanelFinanciamiento, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(201, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jPanelPersonales, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jPanelFinanciamiento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPaneAmortizacion, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Financiamientos", jPanel1);

        jButtonEfectuarPago.setText("Aceptar");
        jButtonEfectuarPago.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonEfectuarPagoActionPerformed(evt);
            }
        });

        jButtonCancelar1.setText("Cancelar");
        jButtonCancelar1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonCancelar1ActionPerformed(evt);
            }
        });

        jButtonReimprimirCobro.setText("Reimprimir");
        jButtonReimprimirCobro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonReimprimirCobroActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButtonEfectuarPago)
                .addGap(64, 64, 64)
                .addComponent(jButtonReimprimirCobro)
                .addGap(47, 47, 47)
                .addComponent(jButtonCancelar1)
                .addGap(364, 364, 364))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap(29, Short.MAX_VALUE)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonEfectuarPago)
                    .addComponent(jButtonReimprimirCobro)
                    .addComponent(jButtonCancelar1))
                .addContainerGap())
        );

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos del cliente"));

        jTextFieldCodCli1.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTextFieldCodCli1FocusLost(evt);
            }
        });

        jLabel11.setText("Cliente");

        jButton6.setText("...");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        jTextFieldNomCli1.setEditable(false);

        jLabel12.setText("Financiamiento");

        jButton7.setText("...");
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel12)
                    .addComponent(jLabel11))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jTextFieldCodCli1, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldNomCli1, javax.swing.GroupLayout.PREFERRED_SIZE, 338, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jTextFieldCodFin, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton7))))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap(27, Short.MAX_VALUE)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jTextFieldNomCli1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton6)
                    .addComponent(jTextFieldCodCli1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jButton7)
                    .addComponent(jTextFieldCodFin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel12)))
        );

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "codigo", "Fecha", "Interés", "Cuota", "Mora", "Monto", "Pago", "Status"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, true, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane1.setViewportView(jTable1);

        jButtonFindCuotas.setText("Agregar Cuota");
        jButtonFindCuotas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonFindCuotasActionPerformed(evt);
            }
        });

        jLabelTotalCobro.setFont(new java.awt.Font("Ubuntu", 1, 48)); // NOI18N
        jLabelTotalCobro.setForeground(new java.awt.Color(255, 0, 0));
        jLabelTotalCobro.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabelTotalCobro.setText("0");

        jLabelTotalCobro1.setFont(new java.awt.Font("Ubuntu", 1, 48)); // NOI18N
        jLabelTotalCobro1.setForeground(new java.awt.Color(255, 0, 0));
        jLabelTotalCobro1.setText("Total :");

        jButtonRemoverItems.setText("Remover cuota seleccionada");
        jButtonRemoverItems.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonRemoverItemsActionPerformed(evt);
            }
        });

        jPanel31.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos del cobro"));

        try {
            jTextFieldFecha1.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##-##-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jTextFieldFecha1.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTextFieldFecha1focusLostPrestamo(evt);
            }
        });

        jLabel40.setText("Fecha");

        javax.swing.GroupLayout jPanel31Layout = new javax.swing.GroupLayout(jPanel31);
        jPanel31.setLayout(jPanel31Layout);
        jPanel31Layout.setHorizontalGroup(
            jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel31Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel40)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextFieldFecha1, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(55, Short.MAX_VALUE))
        );
        jPanel31Layout.setVerticalGroup(
            jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel31Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jTextFieldFecha1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel40))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabelTotalCobro1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabelTotalCobro, javax.swing.GroupLayout.PREFERRED_SIZE, 287, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(344, 344, 344)
                        .addComponent(jButtonFindCuotas, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jButtonRemoverItems)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap(62, Short.MAX_VALUE)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jPanel31, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(165, 165, 165))
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                    .addContainerGap(21, Short.MAX_VALUE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1012, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel31, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(20, 20, 20)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonFindCuotas)
                    .addComponent(jButtonRemoverItems))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 226, Short.MAX_VALUE)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelTotalCobro)
                    .addComponent(jLabelTotalCobro1))
                .addContainerGap())
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                    .addContainerGap(263, Short.MAX_VALUE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(81, 81, 81)))
        );

        jTabbedPane1.addTab("Cobrar", jPanel3);

        jPanel4.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                clientesFocusGained(evt);
            }
        });

        jBtnGuardarCli.setText("Guardar");
        jBtnGuardarCli.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnGuardarCliActionPerformed(evt);
            }
        });

        jBtnEliminarCli.setText("Eliminar");
        jBtnEliminarCli.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnEliminarCliActionPerformed(evt);
            }
        });

        jBtnImprimirCli.setText("Imprimir");

        jBtnCancelarCli.setText("Cancelar");
        jBtnCancelarCli.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnCancelarCliActionPerformed(evt);
            }
        });

        jButtonBalance.setText("Consultar Balance");
        jButtonBalance.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonBalanceActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addComponent(jBtnGuardarCli)
                .addGap(18, 18, 18)
                .addComponent(jBtnEliminarCli)
                .addGap(18, 18, 18)
                .addComponent(jBtnImprimirCli)
                .addGap(18, 18, 18)
                .addComponent(jBtnCancelarCli)
                .addGap(18, 18, 18)
                .addComponent(jButtonBalance)
                .addContainerGap(23, Short.MAX_VALUE))
        );

        jPanel8Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jBtnCancelarCli, jBtnEliminarCli, jBtnGuardarCli, jBtnImprimirCli});

        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBtnGuardarCli)
                    .addComponent(jBtnEliminarCli)
                    .addComponent(jBtnImprimirCli)
                    .addComponent(jBtnCancelarCli)
                    .addComponent(jButtonBalance))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos personales"));

        jLabel3.setText("Nombre");

        jLabel13.setText("Cédula");

        jLabel14.setText("Apellido");

        jLabel15.setText("Dirección");

        try {
            jTextCedCli.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###-#######-#")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addComponent(jLabel13)
                    .addComponent(jLabel15))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(jPanel9Layout.createSequentialGroup()
                            .addComponent(jTextNombCli, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jLabel14)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jTextApellCli, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(jTextDirCli))
                    .addComponent(jTextCedCli, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 11, Short.MAX_VALUE))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel14)
                        .addComponent(jTextApellCli, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel3)
                        .addComponent(jTextNombCli, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel13)
                    .addComponent(jTextCedCli, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(jTextDirCli, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabel20.setText("Buscar:");

        jTextField1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextField1KeyReleased(evt);
            }
        });

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel20)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 219, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTableClientes.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null}
            },
            new String [] {
                "Codigo", "Nombre", "Apellido", "Cédula", "Dirección"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableClientes.setColumnSelectionAllowed(true);
        jTableClientes.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTableClientesMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(jTableClientes);
        jTableClientes.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 1007, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(49, Short.MAX_VALUE))
        );

        jPanel27.setBorder(javax.swing.BorderFactory.createTitledBorder("Información de contacto"));

        jTableTelCli.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Tipo", "Número"
            }
        ));
        jScrollPane8.setViewportView(jTableTelCli);

        jLabel35.setText("E-mail");

        jButton4.setText("Agregar Telefono");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel27Layout = new javax.swing.GroupLayout(jPanel27);
        jPanel27.setLayout(jPanel27Layout);
        jPanel27Layout.setHorizontalGroup(
            jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel27Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addComponent(jButton4))
                .addContainerGap())
            .addGroup(jPanel27Layout.createSequentialGroup()
                .addComponent(jLabel35)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextNombCli1, javax.swing.GroupLayout.DEFAULT_SIZE, 296, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel27Layout.setVerticalGroup(
            jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel27Layout.createSequentialGroup()
                .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 29, Short.MAX_VALUE)
                .addGroup(jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel35)
                    .addComponent(jTextNombCli1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(241, 241, 241)
                        .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(642, 642, 642)
                        .addComponent(jPanel27, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(16, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel27, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Clientes", jPanel4);

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos personales"));

        jLabel16.setText("Nombre");

        jLabel17.setText("Cédula");

        jLabel18.setText("Apellido");

        jLabel19.setText("Dirección");

        try {
            jTextCedGar.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###-#######-#")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel16)
                    .addComponent(jLabel17)
                    .addComponent(jLabel19))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(jPanel10Layout.createSequentialGroup()
                            .addComponent(jTextNombGar, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel18)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jTextApellGar, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(jTextDirGar))
                    .addComponent(jTextCedGar, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 8, Short.MAX_VALUE))
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(jLabel18)
                    .addComponent(jTextNombGar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextApellGar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(12, 12, 12)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel17)
                    .addComponent(jTextCedGar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel19)
                    .addComponent(jTextDirGar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jBtnGuardarGar.setText("Guardar");
        jBtnGuardarGar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnGuardarGarActionPerformed(evt);
            }
        });

        jBtnEliminarGar.setText("Eliminar");
        jBtnEliminarGar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnEliminarGarActionPerformed(evt);
            }
        });

        jBtnImprimirGar.setText("Imprimir");

        jBtnCancelarGar.setText("Cancelar");
        jBtnCancelarGar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnCancelarGarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGap(117, 117, 117)
                .addComponent(jBtnGuardarGar)
                .addGap(18, 18, 18)
                .addComponent(jBtnEliminarGar)
                .addGap(18, 18, 18)
                .addComponent(jBtnImprimirGar)
                .addGap(18, 18, 18)
                .addComponent(jBtnCancelarGar)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBtnGuardarGar)
                    .addComponent(jBtnEliminarGar)
                    .addComponent(jBtnImprimirGar)
                    .addComponent(jBtnCancelarGar))
                .addContainerGap(16, Short.MAX_VALUE))
        );

        jLabel21.setText("Buscar:");

        jTextField2.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextField1KeyReleased(evt);
            }
        });

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel21)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 219, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTableGarantes.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null}
            },
            new String [] {
                "Codigo", "Nombre", "Apellido", "Cédula", "Dirección"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableGarantes.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTableGarantesMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(jTableGarantes);
        jTableGarantes.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);

        jPanel28.setBorder(javax.swing.BorderFactory.createTitledBorder("Información de contacto"));

        jTableTelGar.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Tipo", "Número"
            }
        ));
        jScrollPane9.setViewportView(jTableTelGar);

        jLabel36.setText("E-mail");

        jButton5.setText("Agregar Telefono");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel28Layout = new javax.swing.GroupLayout(jPanel28);
        jPanel28.setLayout(jPanel28Layout);
        jPanel28Layout.setHorizontalGroup(
            jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel28Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jButton5)
                    .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addContainerGap())
            .addGroup(jPanel28Layout.createSequentialGroup()
                .addComponent(jLabel36)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextNombCli2, javax.swing.GroupLayout.DEFAULT_SIZE, 296, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel28Layout.setVerticalGroup(
            jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel28Layout.createSequentialGroup()
                .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 40, Short.MAX_VALUE)
                .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel36)
                    .addComponent(jTextNombCli2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 1011, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addComponent(jPanel28, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(107, 107, 107))))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel28, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 213, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Garantes", jPanel5);

        jPanel16.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos personales"));

        jLabel22.setText("Nombre");

        jLabel23.setText("Cédula");

        jLabel24.setText("Apellido");

        jLabel25.setText("Dirección");

        try {
            jTextCedCob.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###-#######-#")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel22)
                    .addComponent(jLabel23)
                    .addComponent(jLabel25))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel16Layout.createSequentialGroup()
                        .addComponent(jTextNombCob, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel24)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextApellCob, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jTextDirCob)
                    .addComponent(jTextCedCob, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel22)
                    .addComponent(jLabel24)
                    .addComponent(jTextNombCob, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextApellCob, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23)
                    .addComponent(jTextCedCob, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel25)
                    .addComponent(jTextDirCob, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jBtnGuardarCob.setText("Guardar");
        jBtnGuardarCob.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnGuardarCobActionPerformed(evt);
            }
        });

        jBtnEliminarCob.setText("Eliminar");
        jBtnEliminarCob.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnEliminarCobActionPerformed(evt);
            }
        });

        jBtnImprimirCob.setText("Imprimir");

        jBtnCancelarCob.setText("Cancelar");
        jBtnCancelarCob.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnCancelarCobActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
        jPanel17.setLayout(jPanel17Layout);
        jPanel17Layout.setHorizontalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addGap(117, 117, 117)
                .addComponent(jBtnGuardarCob)
                .addGap(18, 18, 18)
                .addComponent(jBtnEliminarCob)
                .addGap(18, 18, 18)
                .addComponent(jBtnImprimirCob)
                .addGap(18, 18, 18)
                .addComponent(jBtnCancelarCob)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel17Layout.setVerticalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBtnGuardarCob)
                    .addComponent(jBtnEliminarCob)
                    .addComponent(jBtnImprimirCob)
                    .addComponent(jBtnCancelarCob))
                .addContainerGap(16, Short.MAX_VALUE))
        );

        jLabel26.setText("Buscar:");

        jTextField3.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextField1KeyReleased(evt);
            }
        });

        javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
        jPanel18.setLayout(jPanel18Layout);
        jPanel18Layout.setHorizontalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel18Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel26)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 219, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel18Layout.setVerticalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel18Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel26)
                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTableCobradores.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null}
            },
            new String [] {
                "Codigo", "Nombre", "Apellido", "Cédula", "Dirección"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableCobradores.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTableCobradoresMouseClicked(evt);
            }
        });
        jScrollPane4.setViewportView(jTableCobradores);
        jTableCobradores.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);

        jPanel29.setBorder(javax.swing.BorderFactory.createTitledBorder("Información de contacto"));

        jTableTelCob.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Tipo", "Número"
            }
        ));
        jScrollPane10.setViewportView(jTableTelCob);

        jLabel37.setText("E-mail");

        jButton8.setText("Agregar Telefono");
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel29Layout = new javax.swing.GroupLayout(jPanel29);
        jPanel29.setLayout(jPanel29Layout);
        jPanel29Layout.setHorizontalGroup(
            jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel29Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jButton8)
                    .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addContainerGap())
            .addGroup(jPanel29Layout.createSequentialGroup()
                .addComponent(jLabel37)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextNombCli3, javax.swing.GroupLayout.DEFAULT_SIZE, 296, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel29Layout.setVerticalGroup(
            jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel29Layout.createSequentialGroup()
                .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)
                .addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel37)
                    .addComponent(jTextNombCli3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel18, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel15Layout.createSequentialGroup()
                        .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(jPanel29, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane4))
                .addGap(109, 109, 109))
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel15Layout.createSequentialGroup()
                        .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel29, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Cobradores", jPanel15);

        jPanel20.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos personales"));

        jLabel27.setText("Nombre");

        jLabel28.setText("Cédula");

        jLabel29.setText("Apellido");

        jLabel30.setText("Dirección");

        try {
            jTextCedUsuario.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###-#######-#")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        javax.swing.GroupLayout jPanel20Layout = new javax.swing.GroupLayout(jPanel20);
        jPanel20.setLayout(jPanel20Layout);
        jPanel20Layout.setHorizontalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel20Layout.createSequentialGroup()
                .addGap(16, 16, 16)
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel27)
                    .addComponent(jLabel28)
                    .addComponent(jLabel30))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(jPanel20Layout.createSequentialGroup()
                            .addComponent(jTextNombUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addComponent(jLabel29)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jTextApellUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(jTextDirUsuario))
                    .addComponent(jTextCedUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel20Layout.setVerticalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel20Layout.createSequentialGroup()
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel27)
                    .addComponent(jLabel29)
                    .addComponent(jTextNombUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextApellUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel28)
                    .addComponent(jTextCedUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel30)
                    .addComponent(jTextDirUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 0, Short.MAX_VALUE))
        );

        jTextField4.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextField1KeyReleased(evt);
            }
        });

        jLabel31.setText("Buscar:");

        javax.swing.GroupLayout jPanel22Layout = new javax.swing.GroupLayout(jPanel22);
        jPanel22.setLayout(jPanel22Layout);
        jPanel22Layout.setHorizontalGroup(
            jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel22Layout.createSequentialGroup()
                .addGap(30, 30, 30)
                .addComponent(jLabel31)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 219, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel22Layout.setVerticalGroup(
            jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel22Layout.createSequentialGroup()
                .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel31)
                    .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 12, Short.MAX_VALUE))
        );

        jTableUsuarios.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null}
            },
            new String [] {
                "Codigo", "Nombre", "Apellido", "Cédula", "Dirección"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableUsuarios.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTableUsuariosMouseClicked(evt);
            }
        });
        jScrollPane5.setViewportView(jTableUsuarios);
        jTableUsuarios.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);

        jPanel23.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos de sesión"));

        jLabel32.setText("Nick");

        jLabel33.setText("Clave");

        jLabel34.setText("Confirmar clave");

        javax.swing.GroupLayout jPanel23Layout = new javax.swing.GroupLayout(jPanel23);
        jPanel23.setLayout(jPanel23Layout);
        jPanel23Layout.setHorizontalGroup(
            jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel23Layout.createSequentialGroup()
                .addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel32)
                    .addComponent(jLabel33))
                .addGap(24, 24, 24)
                .addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jTextNickUsuario)
                    .addComponent(jTextClaveUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(31, 31, 31)
                .addComponent(jLabel34)
                .addGap(18, 18, 18)
                .addComponent(jTextReptClaveUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel23Layout.setVerticalGroup(
            jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel23Layout.createSequentialGroup()
                .addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel32)
                    .addComponent(jTextNickUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel34)
                    .addComponent(jTextReptClaveUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextClaveUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel33))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jBtnGuardarUsuario.setText("Guardar");
        jBtnGuardarUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnGuardarUsuarioActionPerformed(evt);
            }
        });

        jBtnEliminarUsuario.setText("Eliminar");
        jBtnEliminarUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnEliminarUsuarioActionPerformed(evt);
            }
        });

        jBtnImprimirUsuario.setText("Imprimir");

        jBtnCancelarUsuario.setText("Cancelar");
        jBtnCancelarUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnCancelarUsuarioActionPerformed(evt);
            }
        });

        jButtonPermisos.setText("Control de accesos");
        jButtonPermisos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonPermisosActionPerformed(evt);
            }
        });

        jButtonLog.setText("Ver log");

        javax.swing.GroupLayout jPanel21Layout = new javax.swing.GroupLayout(jPanel21);
        jPanel21.setLayout(jPanel21Layout);
        jPanel21Layout.setHorizontalGroup(
            jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel21Layout.createSequentialGroup()
                .addGap(119, 119, 119)
                .addComponent(jBtnGuardarUsuario)
                .addGap(18, 18, 18)
                .addComponent(jBtnEliminarUsuario)
                .addGap(18, 18, 18)
                .addComponent(jBtnImprimirUsuario)
                .addGap(18, 18, 18)
                .addComponent(jBtnCancelarUsuario)
                .addGap(18, 18, 18)
                .addComponent(jButtonPermisos)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButtonLog)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel21Layout.setVerticalGroup(
            jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel21Layout.createSequentialGroup()
                .addGroup(jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBtnGuardarUsuario)
                    .addComponent(jBtnEliminarUsuario)
                    .addComponent(jBtnImprimirUsuario)
                    .addComponent(jBtnCancelarUsuario)
                    .addComponent(jButtonPermisos)
                    .addComponent(jButtonLog))
                .addGap(0, 14, Short.MAX_VALUE))
        );

        jPanel30.setBorder(javax.swing.BorderFactory.createTitledBorder("Información de contacto"));

        jTableTelUser.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Tipo", "Número"
            }
        ));
        jScrollPane11.setViewportView(jTableTelUser);

        jLabel38.setText("E-mail");

        jButton9.setText("Agregar Telefono");
        jButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton9ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel30Layout = new javax.swing.GroupLayout(jPanel30);
        jPanel30.setLayout(jPanel30Layout);
        jPanel30Layout.setHorizontalGroup(
            jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel30Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jButton9)
                    .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addContainerGap())
            .addGroup(jPanel30Layout.createSequentialGroup()
                .addComponent(jLabel38)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextNombCli4, javax.swing.GroupLayout.DEFAULT_SIZE, 296, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel30Layout.setVerticalGroup(
            jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel30Layout.createSequentialGroup()
                .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton9)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 38, Short.MAX_VALUE)
                .addGroup(jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel38)
                    .addComponent(jTextNombCli4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel19Layout = new javax.swing.GroupLayout(jPanel19);
        jPanel19.setLayout(jPanel19Layout);
        jPanel19Layout.setHorizontalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel19Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel19Layout.createSequentialGroup()
                        .addComponent(jPanel21, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(257, 257, 257))
                    .addGroup(jPanel19Layout.createSequentialGroup()
                        .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jScrollPane5, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel22, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel19Layout.createSequentialGroup()
                                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jPanel23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jPanel30, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap())))
        );
        jPanel19Layout.setVerticalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel19Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel19Layout.createSequentialGroup()
                        .addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(12, 12, 12))
                    .addGroup(jPanel19Layout.createSequentialGroup()
                        .addComponent(jPanel30, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addComponent(jPanel21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 189, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Usuarios", jPanel19);

        jTabbedPane2.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jTabbedPane2StateChanged(evt);
            }
        });

        jTableFinanciamientos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null, null}
            },
            new String [] {
                "Código", "Fecha", "Método", "Interés", "Plazo", "Frecuencia de las cuotas", "Cuotas", "Capital", "Pendiente", "Cobrado", "Esperado"
            }
        ));
        jScrollPane6.setViewportView(jTableFinanciamientos);
        jTableFinanciamientos.getColumnModel().getColumn(10).setHeaderValue("Esperado");

        javax.swing.GroupLayout jPanel25Layout = new javax.swing.GroupLayout(jPanel25);
        jPanel25.setLayout(jPanel25Layout);
        jPanel25Layout.setHorizontalGroup(
            jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel25Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 992, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(83, Short.MAX_VALUE))
        );
        jPanel25Layout.setVerticalGroup(
            jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel25Layout.createSequentialGroup()
                .addGap(101, 101, 101)
                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(217, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab("Análisis de financiamientos", jPanel25);

        jTableCobros.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null}
            },
            new String [] {
                "Código", "Fecha", "Cliente", "Monto", "Forma de pago"
            }
        ));
        jScrollPane7.setViewportView(jTableCobros);

        javax.swing.GroupLayout jPanel26Layout = new javax.swing.GroupLayout(jPanel26);
        jPanel26.setLayout(jPanel26Layout);
        jPanel26Layout.setHorizontalGroup(
            jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel26Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 934, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(141, Short.MAX_VALUE))
        );
        jPanel26Layout.setVerticalGroup(
            jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel26Layout.createSequentialGroup()
                .addGap(72, 72, 72)
                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(239, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab("Análisis de cobros", jPanel26);

        javax.swing.GroupLayout jPanel24Layout = new javax.swing.GroupLayout(jPanel24);
        jPanel24.setLayout(jPanel24Layout);
        jPanel24Layout.setHorizontalGroup(
            jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel24Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 1095, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel24Layout.setVerticalGroup(
            jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel24Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 516, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Análisis", jPanel24);

        jPanel33.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos personales"));

        jLabel41.setText("Nombre");

        jLabel42.setText("RNC");

        jLabel44.setText("Dirección");

        try {
            jTextRncFinanciera.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###-#######-#")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        javax.swing.GroupLayout jPanel33Layout = new javax.swing.GroupLayout(jPanel33);
        jPanel33.setLayout(jPanel33Layout);
        jPanel33Layout.setHorizontalGroup(
            jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel33Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel41)
                    .addComponent(jLabel42)
                    .addComponent(jLabel44))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextDirFinanciera, javax.swing.GroupLayout.PREFERRED_SIZE, 511, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextRncFinanciera, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextNombFinanciera, javax.swing.GroupLayout.PREFERRED_SIZE, 302, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 11, Short.MAX_VALUE))
        );
        jPanel33Layout.setVerticalGroup(
            jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel33Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel41)
                    .addComponent(jTextNombFinanciera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel42)
                    .addComponent(jTextRncFinanciera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel44)
                    .addComponent(jTextDirFinanciera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel34.setBorder(javax.swing.BorderFactory.createTitledBorder("Información de contacto"));

        jTableTelFinanciera.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Tipo", "Número"
            }
        ));
        jScrollPane12.setViewportView(jTableTelFinanciera);

        jLabel45.setText("E-mail");

        jButtonAddPhoneFinanciera.setText("Agregar Telefono");
        jButtonAddPhoneFinanciera.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAddPhoneFinancieraActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel34Layout = new javax.swing.GroupLayout(jPanel34);
        jPanel34.setLayout(jPanel34Layout);
        jPanel34Layout.setHorizontalGroup(
            jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel34Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addComponent(jButtonAddPhoneFinanciera))
                .addContainerGap())
            .addGroup(jPanel34Layout.createSequentialGroup()
                .addComponent(jLabel45)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextEmailFinanciera, javax.swing.GroupLayout.DEFAULT_SIZE, 296, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel34Layout.setVerticalGroup(
            jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel34Layout.createSequentialGroup()
                .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonAddPhoneFinanciera)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 24, Short.MAX_VALUE)
                .addGroup(jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel45)
                    .addComponent(jTextEmailFinanciera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPanel35.setBorder(javax.swing.BorderFactory.createTitledBorder("Mora"));

        jLabel43.setText("Porciento de mora");

        jLabel46.setText("Dias de gracia");

        jSpinnerMoraFinanciera.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1)));

        jSpinnerGraciaMoraFinanciera.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1)));

        javax.swing.GroupLayout jPanel35Layout = new javax.swing.GroupLayout(jPanel35);
        jPanel35.setLayout(jPanel35Layout);
        jPanel35Layout.setHorizontalGroup(
            jPanel35Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel35Layout.createSequentialGroup()
                .addComponent(jLabel43)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSpinnerMoraFinanciera, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(44, 44, 44)
                .addComponent(jLabel46)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSpinnerGraciaMoraFinanciera, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(96, Short.MAX_VALUE))
        );
        jPanel35Layout.setVerticalGroup(
            jPanel35Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel35Layout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(jPanel35Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel43)
                    .addComponent(jLabel46)
                    .addComponent(jSpinnerMoraFinanciera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jSpinnerGraciaMoraFinanciera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(16, Short.MAX_VALUE))
        );

        jButtonAceptConfig.setText("Aceptar");
        jButtonAceptConfig.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAceptConfigActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel32Layout = new javax.swing.GroupLayout(jPanel32);
        jPanel32.setLayout(jPanel32Layout);
        jPanel32Layout.setHorizontalGroup(
            jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel32Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel32Layout.createSequentialGroup()
                        .addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel35, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel33, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel32Layout.createSequentialGroup()
                                .addGap(642, 642, 642)
                                .addComponent(jPanel34, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(16, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel32Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jButtonAceptConfig)
                        .addGap(159, 159, 159))))
        );
        jPanel32Layout.setVerticalGroup(
            jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel32Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel34, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel33, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addComponent(jPanel35, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(143, 143, 143)
                .addComponent(jButtonAceptConfig)
                .addGap(26, 26, 26))
        );

        jTabbedPane1.addTab("Configuración", jPanel32);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1053, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 578, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        Cliente c = new Cliente();
        JFrameFinder buscar = new JFrameFinder(this, 
                Financiera.getInstancia().getClientesAsArray(), 
                new String[]{"código", "nombre", "apellido", "cédula", "dirección"});
        c = Financiera.getInstancia().getCliente(buscar.showDialog());
        this.financiamiento.setCliente(c);
        this.jTextFieldCodCli.setText(String.valueOf(c.getCodigo()));
        this.jTextFieldNomCli.setText(c.getNombre() + " " + c.getApellido());
        
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed

        Garante g = new Garante();
        JFrameFinder buscar = new JFrameFinder(this, 
                Financiera.getInstancia().getGarantesAsArray(), 
                new String[]{"código", "nombre", "apellido", "cédula", "dirección"});
        g = Financiera.getInstancia().getGarante(buscar.showDialog());
        this.financiamiento.setGarante(g);
        this.jTextFieldCodGar.setText(String.valueOf(g.getCodigo()));
        this.jTextFieldNomGar.setText(g.getNombre() + " " + g.getApellido());
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed

        Cobrador c = new Cobrador();
        JFrameFinder buscar = new JFrameFinder(this, 
                Financiera.getInstancia().getCobradoresAsArray(), 
                new String[]{"código", "nombre", "apellido", "cédula", "dirección"});
        c = Financiera.getInstancia().getCobrador(buscar.showDialog());
        this.financiamiento.setCobrador(c);
        this.jTextFieldCodCob.setText(String.valueOf(c.getCodigo()));
        this.jTextFieldNomCob.setText(c.getNombre() + " " + c.getApellido());
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        Cliente c = new Cliente();
        JFrameFinder buscar = new JFrameFinder(this, 
                Financiera.getInstancia().getClientesAsArray(), 
                new String[]{"código", "nombre", "apellido", "cédula", "dirección"});
        c = Financiera.getInstancia().getCliente(buscar.showDialog());
        this.cobro.setCliente(c);
        this.jTextFieldCodCli1.setText(String.valueOf(c.getCodigo()));
        this.jTextFieldNomCli1.setText(c.getNombre() + " " + c.getApellido());
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
        JFrameFinder buscar = new JFrameFinder(this, 
                Financiera.getInstancia().getFinanciamientosAsArray(Integer.parseInt(this.jTextFieldCodCli1.getText())), 
                new String[]{"código", "capital"});
        this.financiamiento = Financiera.getInstancia().getFinanciamiento(buscar.showDialog());
        this.jTextFieldCodFin.setText(String.valueOf(this.financiamiento.getCodigo()));
    }//GEN-LAST:event_jButton7ActionPerformed

    private void jTextFieldCodCliFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldCodCliFocusLost
        Cliente c = new Cliente();
        if (!this.jTextFieldCodCli.getText().equals("") && this.jTextFieldCodCli.getText() != null)
        {
            c = Financiera.getInstancia().getCliente(Integer.parseInt(this.jTextFieldCodCli.getText()));
            this.jTextFieldNomCli.setText(c.getNombre() + " " + c.getApellido());
            this.financiamiento.setCliente(c);
        }
    }//GEN-LAST:event_jTextFieldCodCliFocusLost

    private void jTextFieldCodGarFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldCodGarFocusLost

        Garante g = new Garante();
        if (!this.jTextFieldCodGar.getText().equals("") && this.jTextFieldCodGar.getText() != null)
        {
            g = Financiera.getInstancia().getGarante(Integer.parseInt(this.jTextFieldCodGar.getText()));
            this.jTextFieldNomGar.setText(g.getNombre() + " " + g.getApellido());
            this.financiamiento.setGarante(g);
        }
    }//GEN-LAST:event_jTextFieldCodGarFocusLost

    private void jTextFieldCodCobFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldCodCobFocusLost

        Cobrador c = new Cobrador();
        if (!this.jTextFieldCodCob.getText().equals("") && this.jTextFieldCodCob.getText() != null)
        {
            c = Financiera.getInstancia().getCobrador(Integer.parseInt(this.jTextFieldCodCob.getText()));
            this.jTextFieldNomCob.setText(c.getNombre() + " " + c.getApellido());
            this.financiamiento.setCobrador(c);
        }
    }//GEN-LAST:event_jTextFieldCodCobFocusLost

    private void jButtonAceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAceptarActionPerformed
        
        if (!this.verificarPrivilegios("fcrear"))
            return;
        if (this.financiamiento.isNew())
            Financiera.getInstancia().guardarFinanciamiento(this.financiamiento);
        
        Financiera.getInstancia().imprimirFinanciamiento(this.financiamiento);
        this.limpiarFinanciamiento();
    }//GEN-LAST:event_jButtonAceptarActionPerformed

    private void jButtonCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCancelarActionPerformed
        this.limpiarFinanciamiento();
    }//GEN-LAST:event_jButtonCancelarActionPerformed

    private void jBtnGuardarCliActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnGuardarCliActionPerformed

        try{
            
            if (!this.modCli)
            {
                if (!this.verificarPrivilegios("clicrear"))
                    return;    
            }   
            if (!this.verificarPrivilegios("climodificar"))
                    return;
            
            this.cliente.setNombre(this.jTextNombCli.getText());
            this.cliente.setApellido(this.jTextApellCli.getText());
            this.cliente.setCedula(this.jTextCedCli.getText());
            this.cliente.setDireccion(this.jTextDirCli.getText());
             Financiera.getInstancia().guardarCliente(this.cliente);
            
            JOptionPane.showConfirmDialog(this, "Datos guardados exitosamente");
            this.limpiarCliente();
            this.jTabbedPane1StateChanged(null);
            
        }
        catch(Exception ex){
            JOptionPane.showConfirmDialog(this, "Error al guardar los datos del cliente : " + ex.getMessage());
        }
    }//GEN-LAST:event_jBtnGuardarCliActionPerformed

    private void jBtnGuardarGarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnGuardarGarActionPerformed
        try{
            if(!this.modGar)
            {
                if (!this.verificarPrivilegios("garcrear"))
                    return;
            }
            else
            {
                if (!this.verificarPrivilegios("garmodificar"))
                    return;
                
            }
            
            this.garante.setNombre(this.jTextNombGar.getText());
            this.garante.setApellido(this.jTextApellGar.getText());
            this.garante.setCedula(this.jTextCedGar.getText());
            this.garante.setDireccion(this.jTextDirGar.getText());
            Financiera.getInstancia().guardarGarante(this.garante);
            JOptionPane.showConfirmDialog(this, "Datos guardados exitosamente");
            this.limpiarGarante();
            this.jTabbedPane1StateChanged(null);
        }
        catch(Exception ex){
            JOptionPane.showConfirmDialog(this, "Error al guardar los datos del cliente : " + ex.getMessage());
        }
    }//GEN-LAST:event_jBtnGuardarGarActionPerformed

    private void clientesFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_clientesFocusGained
        //JOptionPane.showConfirmDialog(this, "El cliente tiene el foquito");
        
    }//GEN-LAST:event_clientesFocusGained

    private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
        
        switch(this.jTabbedPane1.getSelectedIndex())
        {
            case 0 :
            {
                break;
            }
            case 1 :
            {
                break;
            }
            case 2 :
            {
                try
                {
                    this.jTableClientes.setModel(new DefaultTableModel(
                    Financiera.getInstancia().getClientesAsArray(), 
                    new String []{"codigo", "nombre", "apellido", "cédula", "dirección"}));
                    
                    sorter = new TableRowSorter(this.jTableClientes.getModel());
                    this.jTableClientes.setRowSorter(sorter);
                        
                }
                catch(Exception ex)
                {
                    JOptionPane.showConfirmDialog(this, "Error al cargar : " + ex.getMessage());
                }
                
                break;
            }
            case 3 :
            {
                try{
                this.jTableGarantes.setModel(new DefaultTableModel(
                    Financiera.getInstancia().getGarantesAsArray(), 
                    new String []{"codigo", "nombre", "apellido", "cédula", "dirección"}));
                    
                    sorter = new TableRowSorter(this.jTableGarantes.getModel());
                    this.jTableGarantes.setRowSorter(sorter);
                }
                catch(Exception ex)
                {}
                break;
            }
            case 4 :
            {
                try{
                this.jTableCobradores.setModel(new DefaultTableModel(
                    Financiera.getInstancia().getCobradoresAsArray(), 
                    new String []{"codigo", "nombre", "apellido", "cédula", "dirección"}));
                    
                    sorter = new TableRowSorter(this.jTableCobradores.getModel());
                    this.jTableCobradores.setRowSorter(sorter);
                }
                catch(Exception ex)
                {}
                break;
            }
            case 5 :
            {
                try{
                this.jTableUsuarios.setModel(new DefaultTableModel(
                    Financiera.getInstancia().getUsuariosAsArray(), 
                    new String []{"codigo", "nombre", "apellido", "cédula", "dirección"}));
                    
                    sorter = new TableRowSorter(this.jTableUsuarios.getModel());
                    this.jTableUsuarios.setRowSorter(sorter);
                }
                catch(Exception ex)
                {}
                break;
            }
            case 7 :
            {
                try{
                    this.llenarConfiguracion();
                }
                catch(Exception ex)
                {}
                break;
            }
        }
            
    }//GEN-LAST:event_jTabbedPane1StateChanged
    private void newFilter(JTextField txt) {
        RowFilter<TableModel, Object> rf = null;
        //If current expression doesn't parse, don't update.
        try {
            rf = RowFilter.regexFilter(txt.getText());
        } 
        catch (java.util.regex.PatternSyntaxException e) {
            JOptionPane.showConfirmDialog(this, "Error : " + e.getMessage());
        }
        sorter.setRowFilter(rf);
    }
    private void jBtnGuardarCobActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnGuardarCobActionPerformed
        try{
            if(this.cobrador.isNew()){
                if (!this.verificarPrivilegios("cobcrear"))
                    return;                
            }
            else{
                if (!this.verificarPrivilegios("cobmodificar"))
                    return;
                
            }
            this.cobrador.setNombre(this.jTextNombCob.getText());
            this.cobrador.setApellido(this.jTextApellCob.getText());
            this.cobrador.setCedula(this.jTextCedCob.getText());
            this.cobrador.setDireccion(this.jTextDirCob.getText());
            
            Financiera.getInstancia().guardarCobrador(this.cobrador);
            
            JOptionPane.showConfirmDialog(this, "Datos guardados exitosamente");
            this.limpiarCobrador();
            this.jTabbedPane1StateChanged(null);
        }
        catch(Exception ex){
            JOptionPane.showConfirmDialog(this, "Error al guardar los datos del cobrador : " + ex.getMessage());
        }
    }//GEN-LAST:event_jBtnGuardarCobActionPerformed

    private void jTableClientesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableClientesMouseClicked
        this.modCli = true;
        this.cliente = Financiera.getInstancia().getCliente(Integer.parseInt(this.jTableClientes.getValueAt(this.jTableClientes.getSelectedRow(), 0).toString()));
        this.jTextNombCli.setText(this.cliente.getNombre());
        this.jTextApellCli.setText(this.cliente.getApellido());
        this.jTextCedCli.setText(this.cliente.getCedula());
        this.jTextDirCli.setText(this.cliente.getDireccion());
        this.mostrarTelefonosClientes();
    }//GEN-LAST:event_jTableClientesMouseClicked
    
    private void jTableGarantesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableGarantesMouseClicked
        this.modGar = true;
        this.garante = Financiera.getInstancia().getGarante(Integer.parseInt(this.jTableGarantes.getValueAt(this.jTableGarantes.getSelectedRow(), 0).toString()));
        this.jTextNombGar.setText(this.jTableGarantes.getValueAt(this.jTableGarantes.getSelectedRow(), 1).toString());
        this.jTextApellGar.setText(this.jTableGarantes.getValueAt(this.jTableGarantes.getSelectedRow(), 2).toString());
        this.jTextCedGar.setText(this.jTableGarantes.getValueAt(this.jTableGarantes.getSelectedRow(), 3).toString());
        this.jTextDirGar.setText(this.jTableGarantes.getValueAt(this.jTableGarantes.getSelectedRow(), 4).toString());
        this.mostrarTelefonosGarantes();
    }//GEN-LAST:event_jTableGarantesMouseClicked

    private void jTableCobradoresMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableCobradoresMouseClicked
        this.modCob = true;
        this.cobrador = Financiera.getInstancia().getCobrador(Integer.parseInt(this.jTableCobradores.getValueAt(this.jTableCobradores.getSelectedRow(), 0).toString()));
        this.jTextNombCob.setText(this.jTableCobradores.getValueAt(this.jTableCobradores.getSelectedRow(), 1).toString());
        this.jTextApellCob.setText(this.jTableCobradores.getValueAt(this.jTableCobradores.getSelectedRow(), 2).toString());
        this.jTextCedCob.setText(this.jTableCobradores.getValueAt(this.jTableCobradores.getSelectedRow(), 3).toString());
        this.jTextDirCob.setText(this.jTableCobradores.getValueAt(this.jTableCobradores.getSelectedRow(), 4).toString());
        this.mostrarTelefonosCobradores();
    }//GEN-LAST:event_jTableCobradoresMouseClicked

    private void jBtnEliminarCliActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnEliminarCliActionPerformed
        if (!this.verificarPrivilegios("clieliminar"))
            return;
        Financiera.getInstancia().eliminarCliente(this.cliente);
        JOptionPane.showConfirmDialog(this, "Registro eliminado exitosamente");
        this.limpiarCliente();
        this.jTabbedPane1StateChanged(null);
    }//GEN-LAST:event_jBtnEliminarCliActionPerformed

    private void jBtnEliminarGarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnEliminarGarActionPerformed
        if (!this.verificarPrivilegios("gareliminar"))
            return;
        Financiera.getInstancia().eliminarGarante(this.garante);
        JOptionPane.showConfirmDialog(this, "Registro eliminado exitosamente");
        this.limpiarGarante();
        this.jTabbedPane1StateChanged(null);
    }//GEN-LAST:event_jBtnEliminarGarActionPerformed

    private void jBtnEliminarCobActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnEliminarCobActionPerformed
        if (!this.verificarPrivilegios("cobeliminar"))
            return;
        Financiera.getInstancia().eliminarCobrador(this.cobrador);
        JOptionPane.showConfirmDialog(this, "Registro eliminado exitosamente");
        this.limpiarCobrador();
        this.jTabbedPane1StateChanged(null);
    }//GEN-LAST:event_jBtnEliminarCobActionPerformed

    private void jTextFieldCodCli1FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldCodCli1FocusLost
        Cliente c = new Cliente();
        if (!this.jTextFieldCodCli1.getText().equals("") && this.jTextFieldCodCli1.getText() != null)
        {
            c = Financiera.getInstancia().getCliente(Integer.parseInt(this.jTextFieldCodCli1.getText()));
            this.jTextFieldNomCli1.setText(c.getNombre());
        }
    }//GEN-LAST:event_jTextFieldCodCli1FocusLost

    private void jButtonFindCuotasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonFindCuotasActionPerformed
        
        JFrameFinder buscar = new JFrameFinder(this, 
                this.financiamiento.getCuotasAsArray(), 
                new String[]{"código", "fecha", "interes", "cuota", "mora", "monto", "financiamiento"});
        this.cobro.agregarItem(this.financiamiento.getCuota(buscar.showDialog()));
        this.mostrarItemsDeCobros();
        
    }//GEN-LAST:event_jButtonFindCuotasActionPerformed
    private void mostrarItemsDeCobros()
    {
            this.jTable1.setModel(new DefaultTableModel(
                    this.cobro.getItemsArray(), 
                    new String []{"código", "fecha", "interes", "cuota", "mora", "monto", "pago", "status"}));
        this.jTable1.getModel().addTableModelListener(this);
    }
    private void jBtnGuardarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnGuardarUsuarioActionPerformed
        try{
            if(this.usuario.isNew())
            {
                if (!this.verificarPrivilegios("ucrear"))
                    return;
            }
            else
            {
                if (!this.verificarPrivilegios("umodificar"))
                    return;
            }
            this.usuario.setNombre(this.jTextNombUsuario.getText());
            this.usuario.setApellido(this.jTextApellUsuario.getText());
            this.usuario.setCedula(this.jTextCedUsuario.getText());
            this.usuario.setDireccion(this.jTextDirUsuario.getText());
            this.usuario.setNombreUsuario(this.jTextNickUsuario.getText());
            this.usuario.setClave(this.jTextClaveUsuario.getPassword().toString());
            this.usuario.setPermisos(this.permisosUsuario);
            Financiera.getInstancia().guardarUsuario(this.usuario);
            JOptionPane.showConfirmDialog(this, "Datos guardados exitosamente");
            this.limpiarUsuario();
            this.jTabbedPane1StateChanged(null);
        }
        catch(Exception ex){
            JOptionPane.showConfirmDialog(this, "Error al guardar los datos del usuario : " + ex.getMessage());
        }
    }//GEN-LAST:event_jBtnGuardarUsuarioActionPerformed

    private void jBtnEliminarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnEliminarUsuarioActionPerformed
        if (!this.verificarPrivilegios("ueliminar"))
            return;
        
        Financiera.getInstancia().eliminarUsuario(this.usuario);
        JOptionPane.showConfirmDialog(this, "Registro eliminado exitosamente");
        this.limpiarUsuario();
        this.jTabbedPane1StateChanged(null);
    }//GEN-LAST:event_jBtnEliminarUsuarioActionPerformed

    private void jTableUsuariosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableUsuariosMouseClicked
        this.modUser = true;
        this.usuario = Financiera.getInstancia().getUsuario(Integer.parseInt(this.jTableUsuarios.getValueAt(this.jTableUsuarios.getSelectedRow(), 0).toString()));
        this.jTextNombUsuario.setText(this.jTableUsuarios.getValueAt(this.jTableUsuarios.getSelectedRow(), 1).toString());
        this.jTextApellUsuario.setText(this.jTableUsuarios.getValueAt(this.jTableUsuarios.getSelectedRow(), 2).toString());
        this.jTextCedUsuario.setText(this.jTableUsuarios.getValueAt(this.jTableUsuarios.getSelectedRow(), 3).toString());
        this.jTextDirUsuario.setText(this.jTableUsuarios.getValueAt(this.jTableUsuarios.getSelectedRow(), 4).toString());
        this.jTextNickUsuario.setText(this.usuario.getNombreUsuario());
        this.jTextClaveUsuario.setText(this.usuario.getClave());
        if (this.usuario.getPermisos() == null) 
            this.permisosUsuario = "";
        else
            this.permisosUsuario = this.usuario.getPermisos();
        
        this.mostrarTelefonosUsuarios();
    }//GEN-LAST:event_jTableUsuariosMouseClicked

    private void jTextField1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField1KeyReleased
        this.newFilter((JTextField)evt.getSource());
    }//GEN-LAST:event_jTextField1KeyReleased

    private void jButtonEfectuarPagoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonEfectuarPagoActionPerformed
        
        if (!this.cobro.isNew())
        {
            if (!this.verificarPrivilegios("cobrar"))
                return;
            Financiera.getInstancia().imprimirCobro(this.cobro);
            this.limpiarCobro();
            return;
        }
        if (!this.verificarPrivilegios("cobrar"))
            return;
        Financiera.getInstancia().setCobro(this.cobro);
        Pagos p = new Pagos(this, true);
        p.setVisible(true);
        this.limpiarCobro();
    }//GEN-LAST:event_jButtonEfectuarPagoActionPerformed

    private void jButtonCancelar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCancelar1ActionPerformed
        this.limpiarCobro();
    }//GEN-LAST:event_jButtonCancelar1ActionPerformed

    private void jBtnCancelarCliActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnCancelarCliActionPerformed
        this.limpiarCliente();
    }//GEN-LAST:event_jBtnCancelarCliActionPerformed

    private void jBtnCancelarGarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnCancelarGarActionPerformed
        this.limpiarGarante();
    }//GEN-LAST:event_jBtnCancelarGarActionPerformed

    private void jBtnCancelarCobActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnCancelarCobActionPerformed
        this.limpiarCobrador();
    }//GEN-LAST:event_jBtnCancelarCobActionPerformed

    private void jBtnCancelarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnCancelarUsuarioActionPerformed
        this.limpiarUsuario();
    }//GEN-LAST:event_jBtnCancelarUsuarioActionPerformed

    private void jTabbedPane2StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane2StateChanged
        switch(this.jTabbedPane2.getSelectedIndex())
        {
            case 0 :
            {
                try
                {
                    this.jTableFinanciamientos.setModel(new DefaultTableModel(
                    Financiera.getInstancia().getFinanciamientosAsArray(), 
                    new String []{"Código", "Fecha", "Método", "Interés", "Plazo", "Frecuencia de cuotas",
                    "Cuotas", "Capital", "Pendiente", "Cobrado", "Esperado"}));
                    
                    sorter = new TableRowSorter(this.jTableFinanciamientos.getModel());
                    this.jTableFinanciamientos.setRowSorter(sorter);
                        
                }
                catch(Exception ex)
                {
                    JOptionPane.showConfirmDialog(this, "Error al cargar : " + ex.getMessage());
                }
                
                break;
            }
            case 1 :
            {
                try{
                this.jTableCobros.setModel(new DefaultTableModel(
                    Financiera.getInstancia().getCobrosAsArray(), 
                    new String []{"Código", "Fecha", "Cliente", "Monto", "Forma de pago"}));
                    
                    sorter = new TableRowSorter(this.jTableCobros.getModel());
                    this.jTableCobros.setRowSorter(sorter);
                }
                catch(Exception ex)
                {
                    JOptionPane.showConfirmDialog(this, "Error al cargar : " + ex.getMessage());
                }
                break;
            }
            case 6 :
            {
                
                break;
            }
        }
    }//GEN-LAST:event_jTabbedPane2StateChanged
    private void mostrarAmortizacion() {
        try
        {
            this.financiamiento.generarAmortizacion();
            this.jTableAmortizacion.setModel(new DefaultTableModel(
                    this.financiamiento.getAmortizacionToArray(), 
                    new String []{"Fecha", "interes", "cuota", "monto", "capital vivo"}));
        }
        catch (Exception ex)
        {
            JOptionPane.showConfirmDialog(this, ex.getMessage());
        }
    }              
    private void focusLostPrestamo(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_focusLostPrestamo
        
        if (evt.getSource() == this.jTextFieldCapital)
            this.financiamiento.setCapital(Double.parseDouble(this.jTextFieldCapital.getText()));
        else if (evt.getSource() == this.jTextFieldTasa)
            this.financiamiento.getTasa().setCantidad(Double.parseDouble(this.jTextFieldTasa.getText()));
        else if (evt.getSource() == this.jTextFieldPlazo)
            this.financiamiento.getPlazo().setCantidad(Integer.parseInt(this.jTextFieldPlazo.getText()));
        else if (evt.getSource() == this.jTextFieldFecha)
        {
            this.financiamiento.setFecha(util.Fechas.valueOf(this.jTextFieldFecha.getText())); 
        }
        
        this.mostrarAmortizacion();
    }//GEN-LAST:event_focusLostPrestamo
    private boolean entradasValidas()
    {
        boolean ok = true;
        for (Component c : this.jPanelFinanciamiento.getComponents())
        {
            if (c.getClass() == JTextField.class)
            {
                JTextField txt = (JTextField)c;
                if (txt.getText().equals(""))
                    ok = false;
            }
        }
        return ok;
    }
    private void jComboBoxsFinancAction(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxsFinancAction
        if(evt.getSource() == this.jComboBoxTipo)
            this.financiamiento.setTipo(this.jComboBoxTipo.getSelectedItem().toString());
        else if(evt.getSource() == this.jComboBoxPeriodoTasa)
            this.financiamiento.getTasa().setPeriodo(this.jComboBoxPeriodoTasa.getSelectedItem().toString());
        else if(evt.getSource() == this.jComboBoxPeriodoPlazo)
            this.financiamiento.getPlazo().setUnidad(this.jComboBoxPeriodoPlazo.getSelectedItem().toString());
        else if(evt.getSource() == this.jComboBoxPeriodoCuotas)
            this.financiamiento.setFrecCuotas(this.jComboBoxPeriodoCuotas.getSelectedItem().toString());
        this.mostrarAmortizacion();
    }//GEN-LAST:event_jComboBoxsFinancAction

    private void jButtonPermisosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPermisosActionPerformed
        JFrameAccesos ac = new JFrameAccesos(this, true, this.permisosUsuario);
        this.permisosUsuario = ac.showDialog();
    }//GEN-LAST:event_jButtonPermisosActionPerformed
    private void llenarFinanciamiento()
    {        
        JFrameFinder buscar = new JFrameFinder(this, 
                Financiera.getInstancia().getFinanciamientosAsArray(), 
                new String[]{"código", "capital"});
        this.financiamiento = Financiera.getInstancia().getFinanciamiento(buscar.showDialog());
        Financiera.getInstancia().setFinanciamiento(this.financiamiento);
        this.jTextFieldCodCli.setText(String.valueOf(this.financiamiento.getCliente().getCodigo()));
        this.jTextFieldNomCli.setText(this.financiamiento.getCliente().getNombre() + " " + this.financiamiento.getCliente().getApellido());
        this.jTextFieldCodGar.setText(String.valueOf(this.financiamiento.getGarante().getCodigo()));
        this.jTextFieldNomGar.setText(this.financiamiento.getGarante().getNombre() + " " + this.financiamiento.getGarante().getApellido());
        this.jTextFieldCodCob.setText(String.valueOf(this.financiamiento.getCobrador().getCodigo()));
        this.jTextFieldNomCob.setText(this.financiamiento.getCobrador().getNombre() + " " + this.financiamiento.getCobrador().getApellido());
        this.jTextFieldFecha.setText(util.Fechas.stringValue(this.financiamiento.getFecha()));
        this.jTextFieldCapital.setText(String.valueOf(this.financiamiento.getCapital()));
        this.jTextFieldTasa.setText(String.valueOf(this.financiamiento.getTasa().getCantidad()));
        this.jTextFieldPlazo.setText(String.valueOf(this.financiamiento.getPlazo().getCantidad()));
        
        
        switch (this.financiamiento.getFrecCuotas())
        {            
            case "Anuales" : 
            {
                this.jComboBoxPeriodoCuotas.setSelectedIndex(0);
                break;
            }
            case "Mensuales" : 
            {
                this.jComboBoxPeriodoCuotas.setSelectedIndex(1);
                break;
            }
            case "Semanales" : 
            {
                this.jComboBoxPeriodoCuotas.setSelectedIndex(2);
                break;
            }
            case "Diarias" : 
            {
                this.jComboBoxPeriodoCuotas.setSelectedIndex(3);
                break;
            }
        }
        switch (this.financiamiento.getPlazo().getUnidad())
        {            
            case "Años" : 
            {
                this.jComboBoxPeriodoPlazo.setSelectedIndex(0);
                break;
            }
            case "Meses" : 
            {
                this.jComboBoxPeriodoPlazo.setSelectedIndex(1);
                break;
            }
            case "Semanas" : 
            {
                this.jComboBoxPeriodoPlazo.setSelectedIndex(2);
                break;
            }
            case "Dias" : 
            {
                this.jComboBoxPeriodoPlazo.setSelectedIndex(3);
                break;
            }
        }
        switch (this.financiamiento.getTasa().getPeriodo())
        {            
            case "Anual" : 
            {
                this.jComboBoxPeriodoTasa.setSelectedIndex(0);
                break;
            }
            case "Mensual" : 
            {
                this.jComboBoxPeriodoTasa.setSelectedIndex(1);
                break;
            }
            case "Semanal" : 
            {
                this.jComboBoxPeriodoTasa.setSelectedIndex(2);
                break;
            }
            case "Diario" : 
            {
                this.jComboBoxPeriodoTasa.setSelectedIndex(3);
                break;
            }
        }
        switch (this.financiamiento.getTipo())
        {            
            case "Método lineal" : 
            {
                this.jComboBoxTipo.setSelectedIndex(0);
                break;
            }
            case "Método francés" : 
            {
                this.jComboBoxTipo.setSelectedIndex(1);
                break;
            }
            case "Capital + interés" : 
            {
                this.jComboBoxTipo.setSelectedIndex(2);
                break;
            }
            case "Solo interés" : 
            {
                this.jComboBoxTipo.setSelectedIndex(3);
                break;
            }
        }
        
        this.jTableAmortizacion.setModel(new DefaultTableModel(this.financiamiento.getAmortizacion(), 
                    new String []{"Fecha", "Interes", "Cuota", "Monto", "Capital vivo"}));
    }
    private void jButtonReimprimirFinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonReimprimirFinActionPerformed
        this.llenarFinanciamiento();
    }//GEN-LAST:event_jButtonReimprimirFinActionPerformed
    private void llenarCobro()
    {
        JFrameFinder buscar = new JFrameFinder(this, 
                Financiera.getInstancia().getCobrosAsArray(), 
                new String[]{"código", "fecha", "Cliente", "Total", "No se que"});
        this.cobro = Financiera.getInstancia().getCobro(buscar.showDialog());
        if (this.cobro.getCliente() != null)
        {
            this.jTextFieldCodCli1.setText(String.valueOf(this.cobro.getCliente().getCodigo()));
            this.jTextFieldNomCli1.setText(this.cobro.getCliente().getNombre() + " " + 
                    this.cobro.getCliente().getApellido());
        }
        this.jTextFieldCodFin.setText(String.valueOf(this.cobro.getItems().get(0).getCuota().getFinanciamiento().getCodigo()));
        this.jLabelTotalCobro.setText(String.valueOf(this.cobro.total()));
        this.mostrarItemsDeCobros();
    }
    private void jButtonReimprimirCobroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonReimprimirCobroActionPerformed
        this.llenarCobro();        
    }//GEN-LAST:event_jButtonReimprimirCobroActionPerformed

    private void jButtonRemoverItemsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRemoverItemsActionPerformed
        int codigo = Integer.parseInt(this.jTable1.getValueAt(this.jTable1.getSelectedRow(), 0).toString());
        this.cobro.removerItem(codigo);
        this.jLabelTotalCobro.setText(String.valueOf(this.cobro.total()));
        this.mostrarItemsDeCobros();
    }//GEN-LAST:event_jButtonRemoverItemsActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        JDialogAddPhone frm = new JDialogAddPhone(this, true);
        this.cliente.getTelefonos().add(frm.showDialog());
        this.mostrarTelefonosClientes();
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        JDialogAddPhone frm = new JDialogAddPhone(this, true);
        this.garante.getTelefonos().add(frm.showDialog());
        this.mostrarTelefonosGarantes();
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
        JDialogAddPhone frm = new JDialogAddPhone(this, true);
        this.cobrador.getTelefonos().add(frm.showDialog());
        this.mostrarTelefonosCobradores();
    }//GEN-LAST:event_jButton8ActionPerformed

    private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
        JDialogAddPhone frm = new JDialogAddPhone(this, true);
        this.usuario.getTelefonos().add(frm.showDialog());
        this.mostrarTelefonosUsuarios();
    }//GEN-LAST:event_jButton9ActionPerformed

    private void jTextFieldFecha1focusLostPrestamo(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldFecha1focusLostPrestamo
        this.cobro.setFecha(util.Fechas.valueOf(this.jTextFieldFecha1.getText()));
    }//GEN-LAST:event_jTextFieldFecha1focusLostPrestamo

    private void jButtonBalanceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonBalanceActionPerformed
        JFrameBalanceClientes frm = new JFrameBalanceClientes(this, this.cliente);
        frm.setVisible(true);
    }//GEN-LAST:event_jButtonBalanceActionPerformed

    private void jButtonAddPhoneFinancieraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddPhoneFinancieraActionPerformed
         JDialogAddPhone frm = new JDialogAddPhone(this, true);
        Financiera.getInstancia().getTelefonos().add(frm.showDialog());
        this.mostrarTelefonosFinanciera();
    }//GEN-LAST:event_jButtonAddPhoneFinancieraActionPerformed

    private void jButtonAceptConfigActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAceptConfigActionPerformed
        try
        {
            Financiera.getInstancia().setNombre(this.jTextNombFinanciera.getText());
            Financiera.getInstancia().setDireccion(this.jTextDirFinanciera.getText());
            Financiera.getInstancia().setRnc(this.jTextRncFinanciera.getText());
            this.jTextEmailFinanciera.setText("");
            Financiera.getInstancia().getMora().setCantidad(Integer.parseInt(this.jSpinnerMoraFinanciera.getValue().toString()));
            Financiera.getInstancia().getMora().setGracia(Integer.parseInt(this.jSpinnerGraciaMoraFinanciera.getValue().toString()));
            Financiera.getInstancia().guardarConfiguracion();
            javax.swing.JOptionPane.showConfirmDialog(this, "Datos guardados satisfactoriamente ");
        }
        catch(Exception ex)
        {
            javax.swing.JOptionPane.showConfirmDialog(this, "Error : " + ex.getMessage());
        }
        
    }//GEN-LAST:event_jButtonAceptConfigActionPerformed
    private void llenarConfiguracion()
    {
        this.jTextNombFinanciera.setText(Financiera.getInstancia().getNombre());
        this.jTextDirFinanciera.setText(Financiera.getInstancia().getDireccion());
        this.jTextRncFinanciera.setText(Financiera.getInstancia().getRnc());
        this.jTextEmailFinanciera.setText("");
        this.jSpinnerMoraFinanciera.setValue(new Integer(Financiera.getInstancia().getMora().getCantidad()));
        this.jSpinnerGraciaMoraFinanciera.setValue(new Integer(Financiera.getInstancia().getMora().getGracia()));
        this.mostrarTelefonosFinanciera();
    }
    public void mostrarTelefonosFinanciera()
    {
        this.jTableTelFinanciera.setModel(new DefaultTableModel(Financiera.getInstancia().getTelefonosAsArray(), new String[]{"Tipo", "Numero"}));
    }
    private void limpiarFinanciamiento()
    {
        
        this.financiamiento = new Financiamiento();
        this.jTextFieldCodCli.setText("");
        this.jTextFieldNomCli.setText("");
        this.jTextFieldCodGar.setText("");
        this.jTextFieldNomGar.setText("");
        this.jTextFieldCodCob.setText("");
        this.jTextFieldNomCob.setText("");
        this.jTextFieldFecha.setText(util.Fechas.stringValue(Calendar.getInstance().getTime()));
        this.jTextFieldCapital.setText("");
        this.jTextFieldTasa.setText("");
        this.jTextFieldPlazo.setText("");
        this.jComboBoxPeriodoCuotas.setSelectedIndex(0);
        this.jComboBoxPeriodoPlazo.setSelectedIndex(0);
        this.jComboBoxPeriodoTasa.setSelectedIndex(0);
        this.jComboBoxTipo.setSelectedIndex(0);
        String[][] data = new String[][]{{" ", " ", " ", " ", " "}};
        this.jTableAmortizacion.setModel(new DefaultTableModel(data, 
                    new String []{"Fecha", "interes", "cuota", "monto de cuota", "balance pendiente"}));
        this.financiamiento.setTipo(this.jComboBoxTipo.getSelectedItem().toString());
        this.financiamiento.getTasa().setPeriodo(this.jComboBoxPeriodoTasa.getSelectedItem().toString());
        this.financiamiento.getPlazo().setUnidad(this.jComboBoxPeriodoPlazo.getSelectedItem().toString());
        this.financiamiento.setFrecCuotas(this.jComboBoxPeriodoCuotas.getSelectedItem().toString());
    }
    
    private void limpiarCobro()
    {
        this.cobro = new Cobro();
        this.jTextFieldFecha1.setText(util.Fechas.stringValue(new Date()));
        this.jTextFieldCodCli1.setText("");
        this.jTextFieldNomCli1.setText("");
        this.jTextFieldCodFin.setText("");
        this.jLabelTotalCobro.setText("0");
        
        this.financiamiento = null;
        
        String[][] data = new String [][]{{" ", " ", " ", " ", " ", " ", " ", " "}};
        this.jTable1.setModel(new DefaultTableModel(data, 
                    new String []{"código", "fecha", "interes", "cuota", "mora", "monto", "pago", "status"}));
        this.jTable1.getModel().addTableModelListener(this);
    }
    
    private void limpiarCliente()
    {
        this.modCli = false;
        this.cliente = new Cliente();
        this.jTextNombCli.setText("");
        this.jTextApellCli.setText("");
        this.jTextCedCli.setText("");
        this.jTextDirCli.setText("");
        this.mostrarTelefonosClientes();
    }
    
    private void limpiarGarante()
    {
        this.modGar = false;
        this.garante = new Garante();
        this.jTextNombGar.setText("");
        this.jTextApellGar.setText("");
        this.jTextCedGar.setText("");
        this.jTextDirGar.setText("");
        this.mostrarTelefonosGarantes();
    }
    
    private void limpiarCobrador()
    {
        this.modCob = false;
        this.cobrador = new Cobrador();
        this.jTextNombCob.setText("");
        this.jTextApellCob.setText("");
        this.jTextCedCob.setText("");
        this.jTextDirCob.setText("");
        this.mostrarTelefonosCobradores();
    }
    
    private void limpiarUsuario()
    {
        this.modUser = false;
        this.usuario = new Usuario();
        this.jTextNombUsuario.setText("");
        this.jTextApellUsuario.setText("");
        this.jTextCedUsuario.setText("");
        this.jTextDirUsuario.setText("");
        this.jTextNickUsuario.setText("");
        this.jTextClaveUsuario.setText("");
        this.jTextReptClaveUsuario.setText("");
        this.permisosUsuario = "";
        this.mostrarTelefonosUsuarios();
    }
    public void mostrarTelefonosClientes()
    {
        this.jTableTelCli.setModel(new DefaultTableModel(this.cliente.getTelefonosAsArray(), new String[]{"Tipo", "Numero"}));
    }
    public void mostrarTelefonosGarantes()
    {
        this.jTableTelGar.setModel(new DefaultTableModel(this.garante.getTelefonosAsArray(), new String[]{"Tipo", "Numero"}));
    }
    public void mostrarTelefonosCobradores()
    {
        this.jTableTelCob.setModel(new DefaultTableModel(this.cobrador.getTelefonosAsArray(), new String[]{"Tipo", "Numero"}));
    }
    public void mostrarTelefonosUsuarios()
    {
        this.jTableTelUser.setModel(new DefaultTableModel(this.usuario.getTelefonosAsArray(), new String[]{"Tipo", "Numero"}));
    }
    @Override
    public void tableChanged(TableModelEvent e) {
        int row = e.getFirstRow();
        int column = e.getColumn();
        if (row < 0 || column != 6)
            return;
        TableModel model = (TableModel)e.getSource();
        
        this.cobro.setMontoItem(Integer.parseInt(model.getValueAt(row, 0).toString()), 
                Double.parseDouble(model.getValueAt(row, 6).toString()));
        this.mostrarItemsDeCobros();
        this.jLabelTotalCobro.setText(String.valueOf(this.cobro.total()));
    }
    
    private boolean verificarPrivilegios(String privilegio)
    {
        boolean ok = true;
        if (Financiera.getInstancia().getUsuario().getPermisos().indexOf(privilegio) < 0)
        {
            JOptionPane.showConfirmDialog(this, "Usted no tiene privilegios para esta operación");
            ok = false;
        }
        return ok;
    }
    
    private Financiamiento financiamiento = new Financiamiento();
    private String permisosUsuario = "";
    private boolean modCli = false;
    private boolean modGar = false;
    private boolean modCob = false;
    private boolean modUser = false;
    private int currGarante = 0;
    private int currCobrador = 0;
    private int currUsuario = 0;
    private Cliente cliente = new Cliente();
    private Cobrador cobrador = new Cobrador();
    private Garante garante = new Garante();
    private Usuario usuario = new Usuario();
    private Cobro cobro = new Cobro();
    TableRowSorter sorter;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBtnCancelarCli;
    private javax.swing.JButton jBtnCancelarCob;
    private javax.swing.JButton jBtnCancelarGar;
    private javax.swing.JButton jBtnCancelarUsuario;
    private javax.swing.JButton jBtnEliminarCli;
    private javax.swing.JButton jBtnEliminarCob;
    private javax.swing.JButton jBtnEliminarGar;
    private javax.swing.JButton jBtnEliminarUsuario;
    private javax.swing.JButton jBtnGuardarCli;
    private javax.swing.JButton jBtnGuardarCob;
    private javax.swing.JButton jBtnGuardarGar;
    private javax.swing.JButton jBtnGuardarUsuario;
    private javax.swing.JButton jBtnImprimirCli;
    private javax.swing.JButton jBtnImprimirCob;
    private javax.swing.JButton jBtnImprimirGar;
    private javax.swing.JButton jBtnImprimirUsuario;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JButton jButtonAceptConfig;
    private javax.swing.JButton jButtonAceptar;
    private javax.swing.JButton jButtonAddPhoneFinanciera;
    private javax.swing.JButton jButtonBalance;
    private javax.swing.JButton jButtonCancelar;
    private javax.swing.JButton jButtonCancelar1;
    private javax.swing.JButton jButtonEfectuarPago;
    private javax.swing.JButton jButtonFindCuotas;
    private javax.swing.JButton jButtonLog;
    private javax.swing.JButton jButtonPermisos;
    private javax.swing.JButton jButtonReimprimirCobro;
    private javax.swing.JButton jButtonReimprimirFin;
    private javax.swing.JButton jButtonRemoverItems;
    private javax.swing.JComboBox jComboBoxPeriodoCuotas;
    private javax.swing.JComboBox jComboBoxPeriodoPlazo;
    private javax.swing.JComboBox jComboBoxPeriodoTasa;
    private javax.swing.JComboBox jComboBoxTipo;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabelTotalCobro;
    private javax.swing.JLabel jLabelTotalCobro1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel18;
    private javax.swing.JPanel jPanel19;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel20;
    private javax.swing.JPanel jPanel21;
    private javax.swing.JPanel jPanel22;
    private javax.swing.JPanel jPanel23;
    private javax.swing.JPanel jPanel24;
    private javax.swing.JPanel jPanel25;
    private javax.swing.JPanel jPanel26;
    private javax.swing.JPanel jPanel27;
    private javax.swing.JPanel jPanel28;
    private javax.swing.JPanel jPanel29;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel30;
    private javax.swing.JPanel jPanel31;
    private javax.swing.JPanel jPanel32;
    private javax.swing.JPanel jPanel33;
    private javax.swing.JPanel jPanel34;
    private javax.swing.JPanel jPanel35;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JPanel jPanelFinanciamiento;
    private javax.swing.JPanel jPanelPersonales;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JScrollPane jScrollPaneAmortizacion;
    private javax.swing.JSpinner jSpinnerGraciaMoraFinanciera;
    private javax.swing.JSpinner jSpinnerMoraFinanciera;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTabbedPane jTabbedPane2;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTableAmortizacion;
    private javax.swing.JTable jTableClientes;
    private javax.swing.JTable jTableCobradores;
    private javax.swing.JTable jTableCobros;
    private javax.swing.JTable jTableFinanciamientos;
    private javax.swing.JTable jTableGarantes;
    private javax.swing.JTable jTableTelCli;
    private javax.swing.JTable jTableTelCob;
    private javax.swing.JTable jTableTelFinanciera;
    private javax.swing.JTable jTableTelGar;
    private javax.swing.JTable jTableTelUser;
    private javax.swing.JTable jTableUsuarios;
    private javax.swing.JTextField jTextApellCli;
    private javax.swing.JTextField jTextApellCob;
    private javax.swing.JTextField jTextApellGar;
    private javax.swing.JTextField jTextApellUsuario;
    private javax.swing.JFormattedTextField jTextCedCli;
    private javax.swing.JFormattedTextField jTextCedCob;
    private javax.swing.JFormattedTextField jTextCedGar;
    private javax.swing.JFormattedTextField jTextCedUsuario;
    private javax.swing.JPasswordField jTextClaveUsuario;
    private javax.swing.JTextField jTextDirCli;
    private javax.swing.JTextField jTextDirCob;
    private javax.swing.JTextField jTextDirFinanciera;
    private javax.swing.JTextField jTextDirGar;
    private javax.swing.JTextField jTextDirUsuario;
    private javax.swing.JTextField jTextEmailFinanciera;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField jTextFieldCapital;
    private javax.swing.JTextField jTextFieldCodCli;
    private javax.swing.JTextField jTextFieldCodCli1;
    private javax.swing.JTextField jTextFieldCodCob;
    private javax.swing.JTextField jTextFieldCodFin;
    private javax.swing.JTextField jTextFieldCodGar;
    private javax.swing.JFormattedTextField jTextFieldFecha;
    private javax.swing.JFormattedTextField jTextFieldFecha1;
    private javax.swing.JTextField jTextFieldNomCli;
    private javax.swing.JTextField jTextFieldNomCli1;
    private javax.swing.JTextField jTextFieldNomCob;
    private javax.swing.JTextField jTextFieldNomGar;
    private javax.swing.JTextField jTextFieldPlazo;
    private javax.swing.JTextField jTextFieldTasa;
    private javax.swing.JTextField jTextNickUsuario;
    private javax.swing.JTextField jTextNombCli;
    private javax.swing.JTextField jTextNombCli1;
    private javax.swing.JTextField jTextNombCli2;
    private javax.swing.JTextField jTextNombCli3;
    private javax.swing.JTextField jTextNombCli4;
    private javax.swing.JTextField jTextNombCob;
    private javax.swing.JTextField jTextNombFinanciera;
    private javax.swing.JTextField jTextNombGar;
    private javax.swing.JTextField jTextNombUsuario;
    private javax.swing.JPasswordField jTextReptClaveUsuario;
    private javax.swing.JFormattedTextField jTextRncFinanciera;
    // End of variables declaration//GEN-END:variables
}
